<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>修改密码</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no,email=no,address=no" />
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <link rel="stylesheet" href="../css/common.css" />
    <link rel="stylesheet" href="../css/y_index.css" />
</head>

<body>
    <div class="pswBox bw">
        <p class="plr24 bdb"><span class="col3 font15">原密码：</span>
            <input type="password" placeholder="请输入原密码" class="h100 font15 col9 ml40" id="psw">
        </p>
        <p class="plr24 bdb"><span class="col3 font15">新密码：</span>
            <input type="password" placeholder="请输入新密码" class="h100 font15 col9 ml40" id="n_psw">
        </p>
        <p class="plr24 bdb"><span class="col3 font15">再次输入新密码：</span>
            <input type="password" placeholder="请再次输入新密码" class="h100 font15 col9 ml40" id="nn_psw">
        </p>
    </div>
    <div class="main_btn tap" style="margin-top: .9rem;">立即修改</div>
</body>

</html>
<script type="text/javascript" src="../js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="../js/dlc.js"></script>
<script>
$(function() {
    $('.main_btn').click(function() {
        var psw = $('#psw').val();
        var n_psw = $('#n_psw').val();
        var nn_psw = $('#nn_psw').val();
        if (isNull(psw)) {
            dlctipbox.show('请输入原密码');
        } else if (isNull(n_psw)) {
            dlctipbox.show('请输入新密码');
        } else if (isNull(nn_psw)) {
            dlctipbox.show('请再次输入新密码');
        } else if (nn_psw != n_psw) {
            dlctipbox.show('两次输入的密码不一致！');
        } else {
            var data = { password: psw, newPassword: n_psw, affirm: nn_psw };
            dlc_request('/qh/updatePassword', data, function(res) {
                console.log(res);
                //                    alert(JSON.stringify(res));
                if (res.code == 1) {
                    dlctipbox.show('修改成功');
                    setTimeout(function() {
                        exitApp();
                    }, 1500);
                } else {
                    dlctipbox.alert(res.msg);
                }
            });
        }
    });
})
</script>